clear all
set more off
set scheme s2color
cd ""

use "sample.dta", clear
bysort city_ch: keep if _n == 1

****************
* Subfigure (1)
****************

#delimit ;
twoway (kdensity age if faction == 1, color(green)) (kdensity age if faction == 0, color(orange)),
        xlabel(40(5)65, labsize(small) tlength(0.8))
        ylabel(, labsize(small) tlength(0.8) grid glwidth(vthin) nogextend)
        ytitle("Kernel density") xtitle("Age (years)") legend(label(1 "With informal tie")
        label(2 "Without informal tie") position(10) ring(0) col(1) size(small))
        graphregion(fcolor(white) color(white) icolor(white) margin(small)) plotregion(margin(vsmall));
#delimit cr

****************
* Subfigure (2)
****************

#delimit ;
twoway (kdensity tenure if faction == 1, color(green)) (kdensity tenure if faction == 0, color(orange)),
        xlabel(0(2)10, labsize(small) tlength(0.8))
        ylabel(, labsize(small) tlength(0.8) grid glwidth(vthin) nogextend)
        ytitle("Kernel density") xtitle("Tenure length (years)") legend(label(1 "With informal tie")
        label(2 "Without informal tie") position(2) ring(0) col(1) size(small))
        graphregion(fcolor(white) color(white) icolor(white) margin(small)) plotregion(margin(vsmall));
#delimit cr
